|
![](/i/fill.gif) |
"Thomas de Groot" <tDOTdegroot@interDOTnlANOTHERDOTnet> wrote:
> Forgive my confusion/ignorance, but I see the same pigment name P_Cloth
> declared three times successively and still the result is correct. How is
> this possible without parse confusion?
>
> Thomas
Here's a simple computer programming example to show how and why this works:
x = 1;
.
.
.
x = x + 1;
In this case, the variable "x" is assigned a value (1), then later it's assigned
a new value based on the old value. This works because when the new value is
assigned, a temporary copy is made of the old value, manipulated (in this case 1
is added), then re-stored in the original location and becomes "x" again.
"P_Cloth" is just a more complex variable that can be manipulated like any
simpler variable. The restriction would be that once "P_Cloth" is defined as a
pigment it must remain a pigment.
This can be a useful technique to make your scenes more readable, and also more
efficient by not leaving intermediate variables laying around.
Regards,
Dave Blandston
Post a reply to this message
|
![](/i/fill.gif) |